package com.seventeen.mq.proxy.server.controller;

import com.alibaba.fastjson.JSON;
import com.seventeen.mq.proxy.server.proxy.ext.ExtProxyMessage;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 测试接受消息Controller
 *
 * @author seventeen
 */
@RestController
@RequestMapping(value = "/mq/proxy/test")
public class TestController
{

    public static final Logger LOGGER = LoggerFactory.getLogger(TestController.class);

    @PostMapping(value = "/testConsumer.json")
    public String testConsumer(@Validated @RequestBody ExtProxyMessage message)
    {
        LOGGER.info("收到消息 {}",JSON.toJSONString(message));
        return "SUCCESS";
    }
}
